#!/bin/bash

# Change to the target directory
cd /root/etf-option/guoxin_jinzheng/cmake-build-debug || { echo "Failed to change to directory /root/etf-option/guoxin_jinzheng/cmake-build-debug"; exit 1; }

# Check if the executable exists
if [ ! -f "guoxin_jinzheng" ]; then
  echo "Error: Executable file guoxin_jinzheng does not exist!"
  exit 1
fi

# Run the executable in the background and redirect output to log.txt
nohup ./guoxin_jinzheng > log.txt 2>&1 &

# Print a success message
echo "guoxin_jinzheng is running in the background. Output is redirected to log.txt."